package com.tang.component.es;

import lombok.Data;
import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.search.fetch.subphase.highlight.HighlightBuilder;
import org.elasticsearch.search.sort.SortOrder;

@Data
public class EsSearchRequest {
    private BoolQueryBuilder bq;

    private String[] fields;

    /**
     * 页数
     *
     * @date 2024/2/22 19:42
     **/
    private Integer from;

    /**
     * 分页大小
     *
     * @date 2024/2/22 19:42
     **/
    private Integer size;

    /**
     * 是否需要快照
     *
     * @date 2024/2/22 19:43
     **/
    private Boolean needScroll = false;

    /**
     * 快照缓存时间
     *
     * @date 2024/2/22 19:44
     **/
    private Long scrollCacheTime = 0L;

    /**
     * 排序字段
     *
     * @date 2024/2/22 19:45
     **/
    private String sortName;

    /**
     * 排序类型
     *
     * @date 2024/2/22 19:46
     **/
    private SortOrder sortOrder = SortOrder.DESC;

    /**
     * 高亮展示
     *
     * @date 2024/2/22 19:46
     **/
    private HighlightBuilder highlighter;

}
